<?
function paintHomeMessage(){?>
<div class="cl-left"></div>
<div id="home-message"></div>

<?}
?>

<div id="panel-home">
    <div id="twet-news">
        <script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 30000,
  width: 129,
  height: 300,
  theme: {
    shell: {
      background: '#333333',
      color: '#ffffff'
    },
    tweets: {
      background: '#000000',
      color: '#ffffff',
      links: '#4aed05'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  }
}).render().setUser('RRTicket').start();
</script>
    
            <div id="category-list">
                <span>Categories</span>
                <div class="mnu-cat"><a class="<?=(0==$this->idCategory?"active":"")?>" href="/events/<?=$this->page?>">All</a></div>
                <?foreach ($this->categories as $category):?>
                    <div class="mnu-cat"><a class="<?=($category['id_categoria']==$this->idCategory?"active":"")?>" href="/events/<?=$this->page?>/<?=$category['id_categoria']?>"><?=$category['categoria']?></a></div>
                <?endforeach;?>
            </div>
        </div>
    <div id="projects-home">
        <?$i=0;
            foreach ($this->projects as $project):
              $i++;
              if($i==4)
                  paintHomeMessage()
                    ?>
            <div class="item">
                <!--<div class="iconos"></div>-->
                <div class="locate">
                    <div><?=$project['ciudad']?></div>
                    <div><?=$project['fecha']?></div>
                </div>
                <div class="title"><span><a href="/event/<?=$project['link_rewrite']?>"><?=$project['titulo']?></a></span></div>
                <div class="project-image">
                    <img  width="123" src="<?="/admin/".str_replace("/".$project['id_proyecto']."/", "/".$project['id_proyecto']."/160x/thumb_", $project['imagen']);?>">
                </div>
                <div class="project-info">
                        <div class="number"><span id="porcentaje_<?=$i?>"><?=round($project['porcentaje'],0)?></span> %</div>
                        <div class="text">raised</div>
                        <div id="progressbar_<?=$i?>"></div>
                        <?if(round($project['importe_solicitado'],0)>0):?>
                        <div class="number"><?=round($project['recaudado'],0)?> of <?=round($project['importe_solicitado'],0)?> &euro;</div>
                        <?endif;?>
                        <div class="number margin"><?=$project['numApoyos']?> <span class="text">attendees</span></div>
                        <div class="number margin"><?=$project['days']?> <span class="text">days</span></div>

                </div>
                <div class="project-bottom">
                    <?=$project['breve_descripcion']?>
                </div>

            </div>
        <?endforeach;
          if($i<4)
                  paintHomeMessage()?>
        <div class="cl"></div>
    </div>
</div>